<!--#include virtual="/dzps/p1.asp"-->
<script language="JScript" runat="Server">
    function ToObject(json) {
        var o;
        eval("o=" + json);
        return o;
    }

    function toArray(s) {
        var dic = Server.CreateObject("Scripting.Dictionary")
        eval("var a=" + json);
        for (var i = 0; i < a.length; i++) {
            var obj = Server.CreateObject("Scripting.Dictionary")
            for (x in a[i]) obj.Add(x, a[i][x])
            dic.Add(i, obj);
        }
        return dic
    }
</script>
<%
dim action,ret,sql,rs,json
json = request.form
action=Easp.Var("action")
if action="prj_del_sel" then
	prj_del_sel
elseif action="t_del_sel" then
	t_del_sel	
elseif action="c_del_sel" then
	c_del_sel
elseif action="u_del_sel" then
	u_del_sel
elseif action="del_seluser" then
	del_seluser
end if
select Case action
	Case "aaaaa" aaaaa
	Case "tz_add":
		tz_add()
	Case "jxdj_upd":
		jxdj_upd()
	Case "jxdj_del":
		jxdj_del()	

	Case "tz":
		tz()
	Case "zj":
		zj()
	Case "zj_add":
		zj_add()
	case "zj_del"
		zj_del()
	case "tz_del"
		tz_del()
	Case "xgwj":
		xgwj()
	Case "xgwj_add":
		xgwj_add()
	case "xgwj_del"
		xgwj_del()
		Case "hzb":
		hzb()
	Case "hzb_add":
		hzb_add()
	case "hzb_del"
		hzb_del()
	Case "yszl":
		yszl()
	Case "yszl_add":
		yszl_add()
	case "yszl_del"
		yszl_del()
		Case "gzjh":
		gzjh()
		Case "gzjh_add":
		gzjh_add()
		case "gzjh_del"
		gzjh_del()
		Case "gzzj":
		gzzj()
		Case "gzzj_add":
		gzzj_add()
		case "gzzj_del"
		gzzj_del()
		case "wcch_list"
        wcch_list()
		Case "wcch_add":
		wcch_add()
		case "wcch_del"
		wcch_del()
		case "wcch_upd"
		wcch_upd()
		Case "zhnr":
		zhnr()
		Case "zhnr_add":
		zhnr_add()
		case "zhnr_del"
		zhnr_del()	
		Case "jxzl":
		jxzl()
		Case "jxzl_add":
		jxzl_add()
		case "jxzl_del"
		jxzl_del()
        		Case "jxgzltj":
		jxgzltj()
		Case "jxgzltj_add":
		jxgzltj_add()
		case "jxgzltj_del"
		jxgzltj_del()
        		Case "jxrw":
		jxrw()
		Case "jxrw_add":
		jxrw_add()
		case "jxrw_del"
		jxrw_del()
        		Case "bkjx_xgwj":
		bkjx_xgwj()
		Case "bkjx_xgwj_add":
		bkjx_xgwj_add()
		case "bkjx_xgwj_del"
		bkjx_xgwj_del()
		Case "jyhd_xgwj":
		jyhd_xgwj()
		Case "jyhd_xgwj_add":
		jyhd_xgwj_add()
		case "jyhd_xgwj_del"
		jyhd_xgwj_del()
				Case "jgkt":
		jgkt()
		Case "jgkt_add":
		jgkt_add()
		case "jgkt_del"
		jgkt_del()
				Case "jxjs":
		jxjs()
		Case "jxjs_add":
		jxjs_add()
		case "jxjs_del"
		jxjs_del()
		Case "pypx":
		pypx()
		Case "pypx_add":
		pypx_add()
		case "pypx_del"
		pypx_del()
				Case "sxsrc":
		sxsrc()
		Case "sxsrc_add":
		sxsrc_add()
		case "sxsrc_del"
		sxsrc_del()
				Case "lcdj_xgwj":
		lcdj_xgwj()
		Case "lcdj_xgwj_add":
		lcdj_xgwj_add()
		case "lcdj_xgwj_del"
		lcdj_xgwj_del()	
		Case "jxjy_xgwj":
		jxjy_xgwj()
		Case "jxjy_xgwj_add":
		jxjy_xgwj_add()
		case "jxjy_xgwj_del"
		jxjy_xgwj_del()
				Case "sbb":
		sbb()
		Case "sbb_add":
		sbb_add()
		case "sbb_del"
		sbb_del()
				Case "hpb":
		hpb()
		Case "hpb_add":
		hpb_add()
		case "hpb_del"
		hpb_del()
		case "jxdj_add"
		jxdj_add()
		case "jxdj_list"
		jxdj_list()	
		case "bh_exist"
		bh_exist()	
		case "jxdj_upd_up"
		jxdj_upd_up()
end select
function jxdj_upd_up()
	dim sqla(10)
	vas "mode","jxdj"
	vas "id",val("id")
	vas "name1","身份证"
	vas "name3",val("i_sfz_d")
	vas "value1",val("bh")
	if rc("select * from [b] where value1={value1} and mode='jxdj' and name1='身份证'") <1 then
		sqla(0)=cr("[b]","name1,name3,mode,value1")
	else
		sqla(0)=xg("[b]","name3","value1={value1} and mode='jxdj' and name1='身份证'")
	end if
	ret=execsw(sqla)
	rt ret
end function
function jxdj_upd()
	dim sqla(10)
	vas "id",val("id")
	sqla(0)=xg2("[jxdj]","bh,ks,jxkm,xm,jxdw,jxfy,jxkssj,jxjssj,type","id={id:int}")
	ret=execsw(sqla)
	rt ret
end function
function bh_exist()
	dim sql,fields
	sql="select bh from [jxdj] where (1=1) and bh={bh} order by id desc"
	if rc(sql)>=1 then
		echo "1"
	else
		echo "0"
	end if
end function
function jxdj_del()
	dim ret
	ret = Easp.Db.Del("[jxdj]","id={id:int}")
	rt ret
end function
function jxdj_list()
	dim sql,fields
	sql="select * from [jxdj] where (1=1) and type={type} order by id desc"
	
	if val("_search")<>"" then
		vas "likeKey" ,"%{=_search}%"
		sql=replace(sql,"1=1","xm like {likeKey}")
	end if
	qry2json(sql)
end function
function jxdj_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if
	vas "mode","jxdj"
	sqla(0)=cr("[jxdj]","bh,ks,jxkm,xm,jxdw,jxfy,jxkssj,jxjssj,type")
	vas "name1","身份证"
	vas "name3",val("i_sfz_d")
	vas "value1",val("bh")
	'sqla(1)=cr("[b]","name1,name3,mode,value1")
	ret=execsw(sqla)
	rt ret
End Function
function wcch_add()
	dim sqla(10)
	sqla(0)=cr2("[wcch]","xm,hymc,zbdw,chsj,dj,jf,jfly")
	ret=execsw(sqla)
	rt ret
End Function
function wcch_del()
	dim ret
	ret = Easp.Db.Del("[wcch]","id={id:int}")
	rt ret
end function
function wcch_list()
	dim sql,fields
	sql="select * from [wcch] where (1=1)  order by id desc"
	
	if val("_search")<>"" then
		vas "likeKey" ,"%{=_search}%"
		sql=replace(sql,"1=1","xm like {likeKey}")
	end if
	qry2json(sql)
end function
function wcch_upd()
	dim sqla(10)
	vas "id",val("id")
	sqla(0)=xg2("[wcch]","xm,hymc,zbdw,chsj,dj,jf,jfly","id={id:int}")
	ret=execsw(sqla)
	rt ret
end function
Function hpb_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function hpb_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function hpb()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='19' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function sbb_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function sbb_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function sbb()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='18' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function jxjy_xgwj_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function jxjy_xgwj_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function jxjy_xgwj()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='17' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function lcdj_xgwj_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function lcdj_xgwj_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function lcdj_xgwj()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='13' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function sxsrc_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function sxsrc_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function sxsrc()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='14' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function pypx_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function pypx_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function pypx()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='15' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function jxjs_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	del_upload(val("name3"))
	rt ret
End Function
function jxjs_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function jxjs()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='11' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function jgkt_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	del_upload(val("name3"))
	rt ret
End Function
function jgkt_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function jgkt()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='10' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function

Function jyhd_xgwj_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	del_upload(val("name3"))
	rt ret
End Function
function jyhd_xgwj_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function jyhd_xgwj()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='9' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function bkjx_xgwj_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function bkjx_xgwj_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function bkjx_xgwj()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='25' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function

Function jxrw_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function jxrw_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function jxrw()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='26' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function jxgzltj_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function jxgzltj_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function jxgzltj()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='27' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function jxzl_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function jxzl_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function jxzl()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='28' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function zhnr_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function zhnr_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function zhnr()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='23' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)
end function
Function gzzj_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function gzzj_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function gzzj()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='22' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)

end function
Function gzjh_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function gzjh_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function gzjh()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='21' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)

end function
Function yszl_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function yszl_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function yszl()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='7' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)

end function
Function hzb_del()
	dim ret
	s11 "select name3 from baseinfo where id={id:int}","name3"
	Easp.Fso.DelFile  filepath2 & "\dzps\upload\" &val("name3")
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function del_upload(name3)
	Easp.Fso.DelFile  filepath2 & "\dzps\upload\" & name3
end function
function hzb_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function hzb()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='6' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)

end function
Function xgwj_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function xgwj_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function xgwj()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='5' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)

end function
Function tz_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
function tz_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
function tz()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='2' order by id desc"
	if val("zybm")<>"" then
		vas "likeKey" ,"%{=zybm}%"
		sql=replace(sql,"1=1","zym like {likeKey}")
	end if
	qry2json(sql)

end function
function zj()
	dim sql,fields
	sql="select * from [baseinfo] where (1=1) and mode='3' order by id desc"
	qry2json(sql)

end function
function zj_add()
	dim sqla(10)
	if val("name1")="" then
		vas "name1","未命名"	
	end if

	sqla(0)=cr("[baseinfo]","name1,name3,mode")
	ret=execsw(sqla)
	rt ret
End Function
Function zj_del()
	dim ret
	ret = Easp.Db.Del("[baseinfo]","id={id:int}")
	rt ret
End Function
Function t_del_sel()
	dim result,ob,i,ids,ret
	Set ob = toArray(json)
	For i=0 To ob.Count-1
		easp.var("id")=ob(i)("id")
		ret = Easp.Db.del("prj_table","id={id:int}")
	next
	Set ob = Nothing
End Function

Function del_seluser()
	dim result,ob,i,ids,ret
	Set ob = toArray(json)
	For i=0 To ob.Count-1
		' ids=ids&ob(i)("ID") & "," 
		easp.var("id")=ob(i)("id")
		if ob(i)("username")<>"admin" then
			ret = Easp.Db.del("user","id={id:int}")
		end if
	next
	Set ob = Nothing
End Function
Function u_del_sel()
	dim result,ob,i,ids,ret
	Set ob = toArray(json)
	For i=0 To ob.Count-1
		easp.var("id")=ob(i)("id")
		ret = Easp.Db.del("u","id={id:int}")
	next
	Set ob = Nothing
End Function
Function c_del_sel()
	dim result,ob,i,ids,ret
	Set ob = toArray(json)
	For i=0 To ob.Count-1
		easp.var("id")=ob(i)("id")
		ret = Easp.Db.del("center","id={id:int}")
	next
	Set ob = Nothing
End Function
Function prj_del_sel()
	dim result,ob,i,ids,ret

	Set ob = toArray(json)

	For i=0 To ob.Count-1
		' ids=ids&ob(i)("ID") & "," 
		easp.var("id")=ob(i)("id")
		' if ob(i)("username")<>"admin" then
			ret = Easp.Db.del("prj","id={id:int}")
		' end if
	next
	Set ob = Nothing
End Function
function x1()
dim json
json="[{'id':1,'cn':'衷心','f1':null,'f2':null,'f3':null},{'id':6,'cn':'www','f1':null,'f2':null,'f3':null},{'id':7,'cn':'aaaaaa','f1':null,'f2':null,'f3':null},{'id':10,'cn':'aaa1111','f1':null,'f2':null,'f3':null}]"
' easp.echo json
	dim result,ob,i,ids
	Set ob = toArray(json)
	For i=0 To ob.Count-1
	  ids=ids&ob(i)("id") & "," 
	  ' easp.echo ids
	next
	Set ob = Nothing
end function
	
Function js4(fn,tn,title,zdy1,zdy1_title) 
	dim txt
	txt=myr(fn)
	txt=replace(txt,"[dy:tn]",tn)
	txt=replace(txt,"[dy:title]",title)
	txt=replace(txt,"[dy:zdy1]",zdy1)
	txt=replace(txt,"[dy:zdy1_title]",zdy1_title)
	js4=txt
	' Easp.Echo txt
End Function

Function js3(fn,field,title,width) 
	dim txt
	txt=myr(fn)
	txt=replace(txt,"[dy:field]",field)
	txt=replace(txt,"[dy:title]",title)
	if width<>"" then 
		txt=replace(txt,"100",width)
	end if
	js3=txt
	' Easp.Echo txt
End Function
Function js2(fn,fien,label,val) 
	dim txt
	txt=myr(fn)
	txt=replace(txt,"[dy:fieldn]",fien)
	txt=replace(txt,"[dy:label]",label)
	txt=replace(txt,"[dy:value]",val)
	js2=txt
	' Easp.Echo txt
End Function

Function getCheckData()
	dim result,ob,i,ids
	Set ob = toArray(json)
	For i=0 To ob.Count-1
	  ids=ids&ob(i)("ID") & "," 
	next
	easp.var("ids")=left(ids,len(ids)-1)
	Set ob = Nothing	
	result=easp.db.del("jf","id in ({ids})")
End Function
Function ret2(ret)
	if ret=1 then
		retJson "0","成功",""
	else
		retJson "0","失败",""
	end if
End Function

Function ret1(ret)
	if ret=1 then
		easp.echo "1"
	else
		easp.echo "0"
	end if
End Function

Function txt2file(txt)
	WriteToTextFile "D:\wwwroot\wlh_jh8tfd\web\src\" & "layuiadmin\tpl\lse\1\" & session("username") &"" & ".txt",txt,"UTF-8"
End Function

Function myr2 (FileUrl,CharSet)
	FileUrl="D:\wwwroot\wlh_jh8tfd\web\src\" & "layuiadmin\tpl\lse\1\" & FileUrl
	Easp.Echo FileUrl
	Easp.Echo ReadFromTextFile(FileUrl,"UTF-8")
End Function

Function ReadFromTextFile (FileUrl,CharSet)
	dim stm,str
	set stm=server.CreateObject("adodb.stream")
	stm.Type=2 '以本模式读取
	stm.mode=3
	stm.charset=CharSet
	stm.open
	stm.loadfromfile FileUrl
	str=stm.readtext
	stm.Close
	set stm=nothing
	ReadFromTextFile=str
End Function
Sub WriteToTextFile (FileUrl,byval Str,CharSet)
	dim stm
	set stm=server.CreateObject("adodb.stream")
		stm.Type=2 '以本模式读取
		stm.mode=3
		stm.charset=CharSet
		stm.open
		stm.WriteText str
		stm.SaveToFile FileUrl,2
		stm.flush
		stm.Close
	set stm=nothing
End Sub

Function syh(txt)
	txt = chr(34)&txt&chr(34)
	syh=txt
End Function

Function da(txt)
	txt = chr(39)&txt&chr(39)
	da=txt
End Function

Function lbfh(txt)
	txt=da("%"&txt&"%")
	lbfh=" like " & txt
End Function

Function bfh(txt)
	txt=da("%"&txt&"%")
	bfh=txt
End Function

Function dkh(txt)
	txt="{"&txt&"}"
	dkh=txt
End Function

Function xkh(txt)
	txt="("&txt&")"
	xkh=txt
End Function

Function daj(txt)
	txt = "#" & txt& "#"
	daj=txt
End Function






Function hr_1(txt)
	hr_1="field[" & txt & "]"
End Function

Function getCheckData()
	dim result,ob,i,ids
	Set ob = toArray(json)
	For i=0 To ob.Count-1
	  ids=ids&ob(i)("ID") & "," 
	next
	easp.var("ids")=left(ids,len(ids)-1)
	Set ob = Nothing	
	result=easp.db.del("jf","id in ({ids})")
End Function
Function batchQrjf()
	dim result,ob,i,ids,ret
	Set ob = toArray(json)
	For i=0 To ob.Count-1
		' ids=ids&ob(i)("ID") & "," 
		easp.var("id")=ob(i)("ID")
		set rs=easp.db.sel("select qrjf from [jf] where id={id}")
		if rs("qrjf")=0 then
			ret=Easp.Db.Upd ("[jf]","qrjf=1","id={id}")    	
		end if
	next
	Set ob = Nothing
End Function

Function execsw(sqla)
	dim result,i
	easp.db.begin
	' sqla=split(sqls,";")
	for i=0 to ubound(sqla)
		if sqla(i)<>"" then
			result=easp.db.query(sqla(i))
			if not result then
				exit for
			end if
		end if
	next 
	if i<=ubound(sqla) then
		easp.db.RollBack
		execsw=0
	else
		easp.db.Commit
		execsw=1
	end if
End Function

Function retJson(code,msg,data)
		Easp.Echo "{" & syh("code") & ":"&code&","  & syh("msg") & ":" & syh(msg) & "," & syh("data") & ":{}"&"}"
End Function

Function clearSession()
	session("username")=""
	session("password")=""
	session("mc")=""
	session("jxs")=""
	session("gdbs")="0"			
End Function


%>